A bit hacky: we skip parsing values that have a reference or
reference-list type, but we do not error out. Instead, we return a NULL
value, which we catch in the GtkBuildable interface implementation to
get the actual object, and construct a reference list value.
There's still some ickyness around the value type that can only be
solved by having an attribute and role taxonomy.
case GTK_ACCESSIBLE_COLLECT_REFERENCE:
case GTK_ACCESSIBLE_COLLECT_REFERENCE_LIST:
{
+ /* We do not error out, to let the caller code deal
+ * with the references themselves
+ */
res = NULL;
- g_set_error (error, GTK_ACCESSIBLE_VALUE_ERROR,
- GTK_ACCESSIBLE_VALUE_ERROR_INVALID_VALUE,
- "Invalid relation “%s”",
- str);
}
break;
continue;
}
+ if (value == NULL)
+ {
+ GObject *obj = gtk_builder_get_object (accessibility_data->builder,
+ pinfo->value->str);
+
+ if (obj == NULL)
+ {
+ g_warning ("Failed to find accessible object “%s” for relation “%s”",
+ pinfo->value->str,
+ pinfo->name);
+ continue;
+ }
+
+ /* FIXME: Need to distinguish between refs and refslist types */
+ value = gtk_reference_list_accessible_value_new (g_list_append (NULL, obj));
+ }
+
gtk_at_context_set_accessible_relation (context, relation, value);
gtk_accessible_value_unref (value);
}